/*面向对象编程的修饰符号*/

/*
  1-public  公有的  
  2-propected 受保护的 （只有自己和子类访问） 
  3-private  私有的（只能自己类内部看）
  4-readonly 只读修饰符
*/

class Xiaojie{
  public name:string;
  protected age:number;
  private sex:string;
  public readonly hua:string = 'rubblish';
  public constructor(sex:string,name:string,age:number){
    this.name = name;
    this.age = age;
    this.sex = sex;
  }
  public say(){
    console.log("123456");
  }
  private sayHello(){
    console.log("654321");
  }
}

let jie:Xiaojie = new Xiaojie('woman','xiaohua',16);

jie.say();
console.log(jie);

/*
  jie.sayHello();     //私有属性没有办法访问
  jie.hua = "gardon"; //只读属性不能再进行赋值
*/